package com.briup.day24;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class HashSetDemo {

	public static void main(String[] args) {
		Set set = new HashSet();
		set.add("hello");
		set.add("hi");
		set.add("wrp");
		set.add("world");
		
		Iterator iterator = set.iterator();
		while (iterator.hasNext()) {
			System.out.println(iterator.next());
		}
		
		set.forEach(System.out::println);    //java8新特性

	}

}
